package cn.com.cifi.mars.mapper.mars;

import cn.com.cifi.mars.entity.DmDmPlanSignYear;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface DmDmPlanSignYearMapper  extends BaseMapper<DmDmPlanSignYear> {

    void insertList(@Param("list")List<DmDmPlanSignYear> yearList);

    /**
     * 删除指定项目指定时间的数据
     * @param projectId
     * @param yearMonth
     */
    void delByProjectIdAndSnapshootYearMonth(@Param("projectId") String projectId, @Param("yearMonth") Integer yearMonth);

    /**
     * 删除指定时间的数据
     * @param yearMonth
     */
    void delBySnapshootYearMonth(@Param("yearMonth")Integer yearMonth);

    /**
     * 查询小于等于指定年份的指定项目、数据归属时间的数据
     * @param projectIdList
     * @param yearMonth
     * @param year
     * @return
     */
    List<DmDmPlanSignYear> selectByYearAndProjectId(@Param("list") List<String> projectIdList,@Param("yearMonth")Integer yearMonth,
                                                    @Param("year") String year);
    /**
     * 查询指定项目、数据归属时间的数据
     * @param projectIdList
     * @param yearMonth
     * @return
     */
    List<DmDmPlanSignYear> selectByYearMonthAndProjectId(@Param("list") List<String> projectIdList,@Param("yearMonth")Integer yearMonth);

    /**
     * 查询数据归属时间的数据
     * @param yearMonth
     * @return
     */
    List<DmDmPlanSignYear> selectBySnapshootYearMonth(@Param("yearMonth") Integer yearMonth);


    /**
     * 查询全部数据
     * @return
     */
    List<DmDmPlanSignYear> selectAll();

    List<String> selectYearList(@Param("list")List<String> projectIdList, @Param("yearMonth")Integer yearMonthInt);
}
